home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Applications 1999 May / SGI IRIX 6.5 Applications 1999 May.iso / dist / arraysvcs.idb / usr / lib / array / apvm.z / apvm
Text File  |  1998-10-27  |  1KB  |  78 lines

  1. #!/bin/ksh
  2. #
  3. # Simple script to fire up the PVM launcher
  4. #
  5.  
  6. Launcher=/usr/array/PVM/lib/xpvm
  7. Usage="$0 <origin> <display> <array name> [<envvar> <value>]..."
  8.  
  9. #
  10. # Make sure enough args were specified
  11. #
  12. if [ "$#" -lt 3 ]; then
  13.     echo "Incorrect number of arguments to $0"
  14.     echo $Usage
  15.     exit 1
  16. fi
  17.  
  18. #
  19. # Give command line args more meaningful names
  20. #
  21. Origin=$1
  22. DISPLAY=$2
  23. Array=$3
  24. shift 3
  25.  
  26. #
  27. # Set some relevant environment variables that xwsh doesn't handle
  28. #
  29. eval HOME=~$LOGNAME
  30. export DISPLAY HOME
  31.  
  32. #
  33. # Switch to /tmp, since xpvm likes to write to the CWD
  34. #
  35. cd /tmp
  36.  
  37. #
  38. # Set any caller-specified environment variables
  39. #
  40. while [ $# -gt 1 ]; do
  41.     VarName=$1
  42.     VarValue=$2
  43.     
  44.     eval "export $VarName="'"'$VarValue'"'
  45.  
  46.     shift 2
  47. done
  48.  
  49. #
  50. # If the launcher is not installed, quit now
  51. #
  52. if [ ! -x $Launcher ]; then
  53.     /usr/bin/X11/xconfirm             \
  54.         -c                \
  55.         -header "Launch PVM Job"    \
  56.         -t "Sorry, the PVM job launcher $Launcher is not installed" \
  57.         -icon error            \
  58.         > /dev/null
  59.     exit 1
  60. fi
  61.  
  62. #
  63. # Invoke the launcher from an xwsh so that console input & output are available
  64. # Unfortunately, at this time the launcher doesn't understand arrays, so we
  65. # just discard the value of $Array that was passed to us by the caller.
  66. #
  67. exec /usr/sbin/xwsh    \
  68.         -fn "-*-screen-medium-r-normal--12-*-*-*-m-70-iso8859-1" \
  69.         -geometry 80x24            \
  70.         -holdonerror            \
  71.         -iconic                \
  72.         -name XPVMCons            \
  73.         -title "XPVM console"        \
  74.         -ut                \
  75.         -e $Launcher
  76.  
  77. exit 0
  78.